
package ui.adapter;

import android.content.Context;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.LinearLayoutManager;

import net.ck.hzq.R;

import java.util.ArrayList;
import java.util.List;

import Bean.PresentRecordBean;
import base.BaseViewHolder;
import base.SuperBaseAdapter;
import cn.finalteam.loadingviewfinal.RecyclerViewFinal;

/**
 * 提现列表适配器
 * Created by chenjian on 19/2/27.
 */
public class PresentRecordAdapter extends SuperBaseAdapter<PresentRecordBean.ItemsBean> {

    List<PresentRecordBean.ItemsBean> mData = new ArrayList<>();
    Context mContext;

    public PresentRecordAdapter(Context context, List<PresentRecordBean.ItemsBean> data) {
        super(context, data);
        mContext = context;
        mData = data;
    }

    @Override
    protected void convert(BaseViewHolder holder, final PresentRecordBean.ItemsBean item, final int position) {
        holder.setText(R.id.getpresentrecord_txt1, item.getMon())
                .setText(R.id.getpresentrecord_txt2, "提现/购机总额：" + item.getAllmoney() + "元");
        RecyclerViewFinal rv = holder.getView(R.id.refresh_rv);
        rv.setLayoutManager(new LinearLayoutManager(mContext));
        rv.setItemAnimator(new DefaultItemAnimator());
        PresentChildAdapter adapter = new PresentChildAdapter(mContext, item.getData());
        rv.setAdapter(adapter);
    }


    @Override
    protected int getItemViewLayoutId(int position, PresentRecordBean.ItemsBean item) {
        return R.layout.listviewgetpresentrecord_item;
    }

}
